home *** CD-ROM | disk | FTP | other *** search
- /*
- File: AddResMenu7.1.h
-
- Contains: There is a small cosmetic bug in System 7.1 (a bug? Can't even imagine the idea!).
-
- AddResMenu will not alphabatize anything but FONT resource names.
-
- This is obviously not critical, since the names still show up for
- other types, but enough people have written in to DTS to indicate
- that it matters a lot.
-
- So, this small sample includes a function called MyAddResMenu which you
- can use in your applications to get the same functionality as
- AddResMenu under systems before 7.1, it will get all the resource info
- and add the names to the menu you specify.
-
- Have a wonderful time with it.
-
- Written by: C.K. Haun
-
- Copyright: Copyright © 1991-1999 by Apple Computer, Inc., All Rights Reserved.
-
- You may incorporate this Apple sample source code into your program(s) without
- restriction. This Apple sample source code has been provided "AS IS" and the
- responsibility for its operation is yours. You are not permitted to redistribute
- this Apple sample source code as "Apple sample source code" after having made
- changes. If you're going to re-distribute the source, we require that you make
- it clear in the source that the code was descended from Apple sample source
- code, but that you've made changes.
-
- Change History (most recent first):
- 7/16/1999 Karl Groethe Updated for Metrowerks Codewarror Pro 2.1
-
-
- */
- #include <Types.h>
- #include <memory.h>
- #include <Packages.h>
- #include <Errors.h>
- #include <quickdraw.h>
- #include <fonts.h>
- #include <dialogs.h>
- #include <windows.h>
- #include <menus.h>
- #include <events.h>
- #include <OSEvents.h>
- #include <Desk.h>
- #include <diskinit.h>
- #include <OSUtils.h>
- #include <resources.h>
- #include <toolutils.h>
- #include <AppleEvents.h>
- #include <EPPC.h>
- #include <GestaltEqu.h>
- #include <PPCToolbox.h>
- #include <Processes.h>
- #include <Balloons.h>
- #include <Aliases.h>
- #include <Scrap.h>
-
- /* windowControl is the structure attached to every window I create (in the refCon */
- /* field) that contains all the information I need to know about the window. */
- /* data, procedure pointers for controlling, and anything else gets put in this */
- /* struct. That makes my windows autonomous */
- struct windowControl {
- unsigned long windowID; /* master ID number */
- ProcPtr drawMe; /* content drawing procedure pointer */
- ProcPtr clickMe; /* content click routine */
- ProcPtr closeMe; /* document close procedure pointer */
- ProcPtr sizeMe; /* size procedure */
- AliasHandle fileAliasHandle; /* alias for this document */
- Boolean windowDirty;
- Handle generalData; /* cast to whatever you need as you need it */
- };
- typedef struct windowControl windowControl, *windowCPtr, **windowCHandle;
-
- enum {kDocWindowResID = 128,kMyDocumentWindow = 1000};
- /* menu enums */
- enum {kMBarID = 128};
- enum {kAppleMenu = 128,kFileMenu,kEditMenu,kToolsMenu};
-
- /* file menu enums */
- enum {kNewItem = 1,kOpenItem,kCloseItem,kSaveItem,kSaveAsItem,kFileBlank1,kPageSetupItem,kPrintItem,kFileBlank2,kQuitItem};
-
- /* general purpose enums */
- enum {kResumeMask=1,kSampHelp=129,kAboutBox=128,kHelpString=128,kBadSystem=130,kNoneOfThatType=132};
- enum {kResTypeDialog = 131,kResTypeEditLine=4};
- enum {kTestMenuChooseType = 1,kTestMenuDivider};
-
- enum {kMinHeight = 200};
- enum {kGenStrings = 128,kUnnamedString=1};
-
- enum {
- kEnterKey = 0x03,
- kTabKey = 9,
- kReturnKey = 0x0D,
- kBackSpace = 8,
- kEscKey = 0x1B,
- kLeftArrow = 0x1C,
- kRightArrow,
- kUpArrow,
- kDownArrow,
- kDeleteKey = 0x7F
- };
-
-
-
-
-